Seal GtkColorSelectionDialog
authorTim Janik <timj@src.gnome.org>
Fri, 20 Jun 2008 11:02:25 +0000 (11:02 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 20 Jun 2008 11:02:25 +0000 (11:02 +0000)
svn path=/trunk/; revision=20539

gtk/gtkcolorseldialog.c
gtk/gtkcolorseldialog.h

index d1b7c0060341b3aa097ec607b3eb22e124ec6410..356e450b8cc8a9355b867f6a242076c45d3de40f 100644 (file)
 #include "gtkbuildable.h"
 #include "gtkalias.h"
 
+enum {
+  PROP_0,
+  PROP_COLOR_SELECTION,
+  PROP_OK_BUTTON,
+  PROP_CANCEL_BUTTON,
+  PROP_HELP_BUTTON
+};
+
 
 /***************************/
 /* GtkColorSelectionDialog */
@@ -52,9 +60,70 @@ G_DEFINE_TYPE_WITH_CODE (GtkColorSelectionDialog, gtk_color_selection_dialog,
 
 static GtkBuildableIface *parent_buildable_iface;
 
+static void
+gtk_color_selection_dialog_get_property (GObject         *object,
+                                        guint            prop_id,
+                                        GValue          *value,
+                                        GParamSpec      *pspec)
+{
+  GtkColorSelectionDialog *colorsel;
+
+  colorsel = GTK_COLOR_SELECTION_DIALOG (object);
+
+  switch (prop_id)
+    {
+    case PROP_COLOR_SELECTION:
+      g_value_set_object (value, colorsel->colorsel);
+      break;
+    case PROP_OK_BUTTON:
+      g_value_set_object (value, colorsel->ok_button);
+      break;
+    case PROP_CANCEL_BUTTON:
+      g_value_set_object (value, colorsel->cancel_button);
+      break;
+    case PROP_HELP_BUTTON:
+      g_value_set_object (value, colorsel->help_button);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
 static void
 gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
 {
+  GObjectClass   *gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class->get_property = gtk_color_selection_dialog_get_property;
+
+  g_object_class_install_property (gobject_class,
+                                  PROP_COLOR_SELECTION,
+                                  g_param_spec_object ("color-selection",
+                                                    P_("Color Selection"),
+                                                    P_("The color selection embedded in the dialog."),
+                                                    GTK_TYPE_WIDGET,
+                                                    G_PARAM_READABLE));
+  g_object_class_install_property (gobject_class,
+                                  PROP_OK_BUTTON,
+                                  g_param_spec_object ("ok-button",
+                                                    P_("OK Button"),
+                                                    P_("The OK button of the dialog."),
+                                                    GTK_TYPE_WIDGET,
+                                                    G_PARAM_READABLE));
+  g_object_class_install_property (gobject_class,
+                                  PROP_CANCEL_BUTTON,
+                                  g_param_spec_object ("cancel-button",
+                                                    P_("Cancel Button"),
+                                                    P_("The cancel button of the dialog."),
+                                                    GTK_TYPE_WIDGET,
+                                                    G_PARAM_READABLE));
+  g_object_class_install_property (gobject_class,
+                                  PROP_HELP_BUTTON,
+                                  g_param_spec_object ("help-button",
+                                                    P_("Help Button"),
+                                                    P_("The help button of the dialog."),
+                                                    GTK_TYPE_WIDGET,
+                                                    G_PARAM_READABLE));
 }
 
 static void
@@ -118,6 +187,62 @@ gtk_color_selection_dialog_new (const gchar *title)
   return GTK_WIDGET (colorseldiag);
 }
 
+/**
+ * gtk_color_selection_dialog_get_color_selection:
+ * @colorsel: a #GtkColorSelectionDialog
+ *
+ * Retrieves the #GtkColorSelection widget embedded in the dialog.
+ *
+ * Since:  GSEAL-branch
+ **/
+GtkWidget*
+gtk_color_selection_dialog_get_color_selection (GtkColorSelectionDialog *colorsel)
+{
+  return colorsel->colorsel;
+}
+
+/**
+ * gtk_color_selection_dialog_get_ok_button:
+ * @colorsel: a #GtkColorSelectionDialog
+ *
+ * Retrieves the OK button of the dialog.
+ *
+ * Since:  GSEAL-branch
+ **/
+GtkWidget*
+gtk_color_selection_dialog_get_ok_button       (GtkColorSelectionDialog *colorsel)
+{
+  return colorsel->ok_button;
+}
+
+/**
+ * gtk_color_selection_dialog_get_cancel_button:
+ * @colorsel: a #GtkColorSelectionDialog
+ *
+ * Retrieves the cancel button of the dialog.
+ *
+ * Since:  GSEAL-branch
+ **/
+GtkWidget*
+gtk_color_selection_dialog_get_cancel_button   (GtkColorSelectionDialog *colorsel)
+{
+  return colorsel->cancel_button;
+}
+
+/**
+ * gtk_color_selection_dialog_get_help_button:
+ * @colorsel: a #GtkColorSelectionDialog
+ *
+ * Retrieves the help button of the dialog.
+ *
+ * Since:  GSEAL-branch
+ **/
+GtkWidget*
+gtk_color_selection_dialog_get_help_button     (GtkColorSelectionDialog *colorsel)
+{
+  return colorsel->help_button;
+}
+
 static void
 gtk_color_selection_dialog_buildable_interface_init (GtkBuildableIface *iface)
 {
index 38ee923332706f39410daa1a07457cfc63e55efa..c8a04509a20b0a1a32e7df5c60fef8726eae3dc8 100644 (file)
@@ -53,10 +53,10 @@ struct _GtkColorSelectionDialog
 {
   GtkDialog parent_instance;
 
-  GtkWidget *colorsel;
-  GtkWidget *ok_button;
-  GtkWidget *cancel_button;
-  GtkWidget *help_button;
+  GtkWidget *GSEAL (colorsel);
+  GtkWidget *GSEAL (ok_button);
+  GtkWidget *GSEAL (cancel_button);
+  GtkWidget *GSEAL (help_button);
 };
 
 struct _GtkColorSelectionDialogClass
@@ -72,8 +72,12 @@ struct _GtkColorSelectionDialogClass
 
 
 /* ColorSelectionDialog */
-GType      gtk_color_selection_dialog_get_type (void) G_GNUC_CONST;
-GtkWidget* gtk_color_selection_dialog_new      (const gchar *title);
+GType      gtk_color_selection_dialog_get_type            (void) G_GNUC_CONST;
+GtkWidget* gtk_color_selection_dialog_new                 (const gchar *title);
+GtkWidget* gtk_color_selection_dialog_get_color_selection (GtkColorSelectionDialog *colorsel);
+GtkWidget* gtk_color_selection_dialog_get_ok_button       (GtkColorSelectionDialog *colorsel);
+GtkWidget* gtk_color_selection_dialog_get_cancel_button   (GtkColorSelectionDialog *colorsel);
+GtkWidget* gtk_color_selection_dialog_get_help_button     (GtkColorSelectionDialog *colorsel);
 
 
 G_END_DECLS